using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ICharacterSystem
{
    public List<IEnemy> enemy = new List<IEnemy>();
    public IPlayer player;
    public IPlayer NPC;
    public void AddEnemy(IEnemy enemy)
    {
        this.enemy.Add(enemy);
    }
    public void RemoveEnemy(IEnemy enemy)
    {
        this.enemy.Remove(enemy);
    }
    public void SetPlayer(IPlayer player)
    {
        this.player = player;
    }
    public void SetNPC(IPlayer NPC)
    {
        this.NPC = NPC;
    }

    public void Update()
    {
        if(player!=null)
        {
           
            player.UpdateDo();
        }
        if(NPC!=null)
        {
            NPC.UpdateDo();
        }
        if(enemy.Count!=0)
        {
            foreach (IEnemy item in enemy)
            {
                item.UpdateDo();
            }
        }
    }
    
}
